<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:c="http://java.sun.com/jstl/core"
          xmlns:tr="http://myfaces.apache.org/trinidad"
	  lang="pt-br">
    <body>
        
        <ui:composition template="template/template.xhtml">
            
            <ui:define name="titulo">
                Amo Estrada
            </ui:define>

            <ui:define name="conteudo">
                
                <script>
                    function mapa() {
                        url = "mapa.jsf";
                        var mapa = window.open(url, '', 'height=480,width=700,screenY=0,screenX=0,left=100,top=100,directories=no,menubar=no,location=no,resizable=no,scrollbars=yes,status=yes,toolbar=no');
                    }
                </script>
                
              
                
                <h:panelGrid columns="1">
                    
                <h:inputHidden id="coords" value="#{fotoController.coords}"></h:inputHidden>

                <h:selectOneMenu id="tipo" value="#{fotoController.tipoVeiculo}"
                                 converter="SimpleEntityConverter">                       
                    <f:selectItems value="#{fotoController.tipoVeiculos}" 
                                   var="item"
                                   itemLabel="#{item.descricao}"
                                   itemValue="#{item.id}" />
                    
                </h:selectOneMenu>                    
                <span jsfc="h:message" for="tipo" styleClass="msg"></span><br />   
                
        
                <h:selectOneMenu id="veiculo" value="#{fotoController.foto.idVeiculo}" converter="SimpleEntityConverter">                       
                    <f:selectItems value="#{fotoController.veiculos}" 
                                   var="item"
                                   itemLabel="#{item.descricao}"
                                   itemValue="#{item.id}" />
                    
                </h:selectOneMenu>                    
                <span jsfc="h:message" for="veiculo" styleClass="msg"></span><br />      
                
                
                
                
                
                <label jsfc="h:outputLabel" for="descricao">
                        Descrição:
                </label>                
                
                <input jsfc="h:inputText" type="text" id="descricao" 
                                value="#{fotoController.descricao}"
                                styleClass="field" required="true" 
                                size="30" />       
                <span jsfc="h:message" for="descricao" styleClass="msg"></span><br />      
                
                
                <input jsfc="h:inputText" type="text" id="local"                               
                                styleClass="field" required="true" 
                                size="30" />       
                <span jsfc="h:message" for="local" styleClass="msg"></span><br />  
                
                <h:commandLink onclick="mapa();" value="Informar local"></h:commandLink>
                
		
			<h:commandButton value="Salvar"
				action="#{fotoController.salvar}" />	 
		</h:panelGrid>                         
    
            </ui:define>

        </ui:composition>
        
    </body>
</html>
